﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using T.FAS.Runtime.DataAccess.SPI;
using T.FAS.Runtime.Metadata.Entity.DataModel;
using T.FAS.Runtime.DataAccess.ShardingRule;

namespace T.FAS.Runtime.DataAccess.SPI
{
    /// <summary>
    /// 数据删除接口
    /// </summary>
    public interface IDataDeleteService
    {
        /// <summary>
        /// 删除
        /// </summary>
        /// <remarks>按主键数据作为查询依据</remarks>
        /// <param name="CompositeDataObject">领域模型</param>        
        /// <param name="dataID">主键数据</param>
        /// <param name="shardingKeyValue">分库分表键值对</param>
        /// <returns>删除SQL</returns>
        void DeleteByID(CompositeDataObject CompositeDataObject, string dataID, ShardingValue shardingKeyValue = null);

        /// <summary>
        /// 批量删除
        /// </summary>
        /// <remarks>按主键数据作为查询依据</remarks>
        /// <param name="CompositeDataObject">领域模型</param>        
        /// <param name="dataID">主键数据</param>
        /// <param name="shardingKeyValue">分库分表键值对</param>
        /// <returns>删除SQL</returns>
        void DeleteByIDs(CompositeDataObject CompositeDataObject, IEnumerable<string> dataIDs, ShardingValue shardingKeyValue = null);

        /// <summary>
        /// 删除
        /// </summary>
        /// <remarks>按主键数据作为查询依据</remarks>
        /// <param name="CompositeDataObject">领域模型</param> 
        /// <param name="CompositeNodeObject">领域对象</param>
        /// <param name="dataID">主键数据</param>
        /// <param name="shardingKeyValue">分库分表键值对</param>
        /// <returns>删除SQL</returns>
        void DeleteByID(CompositeDataObject CompositeDataObject, CompositeNodeObject CompositeNodeObject, string dataID, ShardingValue shardingKeyValue = null);

        /// <summary>
        /// 批量删除
        /// </summary>
        /// <remarks>按主键数据作为查询依据</remarks>
        /// <param name="CompositeDataObject">领域模型</param> 
        /// <param name="CompositeNodeObject">领域对象</param>
        /// <param name="dataID">主键数据</param>
        /// <param name="shardingKeyValue">分库分表键值对</param>
        /// <returns>删除SQL</returns>
        void DeleteByIDs(CompositeDataObject CompositeDataObject, CompositeNodeObject CompositeNodeObject, IEnumerable<string> dataIDs, ShardingValue shardingKeyValue = null);
    }
}
